#include<bits/stdc++.h>
using namespace std;
int m, n;
vector<int> cnt ;
int cc = 0;
int main()
{
	scanf("%d %d",&m,&n);
	for (int i = m; i <= n; i++) {
		if (i % 4 == 0 && i % 100 != 0 ) {
			cnt.push_back(i);
			cc++;
		}
		if(i%100 == 0 && i % 400 == 0 ){
			cnt.push_back(i);
			cc++;
		}
	}
	printf("%d\n" , cc );
	for(auto x : cnt){
		printf("%d " , x);
	}
	return 0;
}
